<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@page contentType="text/html; charset=GBK" import="user.DisplayRestaurantPage, java.util.*" %>

<% 
	boolean isLogedIn = (session.getAttribute("username") == null) ? false : true; 
	session.setAttribute("isLogedIn", isLogedIn);
%>

<HTML>
<HEAD>
<TITLE>Lumen Restaurant</TITLE>

	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

<base target="_parent"/>

<script language="javascript">
function checkCustomer() {

	if (document.index_customerLoginForm.username.value == "") {
		alert("User name is required!");
		document.index_customerLoginForm.username.focus();
		return false;
	}
	if (document.index_customerLoginForm.password.value=='') {
		alert("password is required!");
		document.index_customerLoginForm.password.focus();
		return false;
	} 
	return true;
}
  				
function checkRestaurant() {
				 
	if (document.index_restaurantLoginForm.username.value=='') {
		alert("User name is required!");
		document.index_restaurantLoginForm.username.focus();
		return false;
	}
	if (document.index_restaurantLoginForm.password.value=='') {
		 alert("password is required!");
		 document.index_restaurantLoginForm.password.focus();
		 return false;
	 }
	return true;
}	
</script>	 

</HEAD>
<BODY leftMargin=0 topMargin=30>

<TABLE cellSpacing=0 cellPadding=0 width=700 align=center border=0>
  <TBODY>
  <TR>
    <TD>
      <DIV align=center><a href="index.jsp"><img height=118 src="Pics/restaurantLogo.JPG" width=242 
  border=0></a></DIV></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD height=50></TD></TR></TBODY></TABLE>

<% if (!isLogedIn) { %>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      
      <div align="center">
      	<TABLE cellSpacing=0 cellPadding=0 width=418 align=center border=0>
      		<TR>
          	<TD colspan="8" align="center">
          		<form method="post" name="index_customerLoginForm" action="./servlet/Login" onSubmit="return checkCustomer(this)" >
          			<table cellSpacing=0 cellPadding=4 width=417 border=0> 
              		<TR>
                	<TD align=right width=73>Customer:</TD>
                	<TD width=62><INPUT id=username size=10 name=username></TD>
                	<TD align=right width=54>Password:</TD>
                	<TD width=62><INPUT id=password type=password size=10  name=password></TD>
                	<TD align="center" width=59>
                		<label><input type="submit" name="Submit" value="Login"></label>
                	</TD>org.tigris.subversion.javahl.ClientException: Working copy not locked; this is probably a bug, please report
svn: Working copy 'D:\Genuitec\WarkspacesMyEclipse\OnlineRestaurant2.0\WebRoot\WEB-INF\classes\user' is missing or not locked

org.tigris.subversion.javahl.ClientException: Working copy not locked; this is probably a bug, please report
svn: Working copy 'D:\Genuitec\WarkspacesMyEclipse\OnlineRestaurant2.0\WebRoot\WEB-INF\classes\user' is missing or not locked


                	<TD align="center" width=59><a href="register.html" target=_blank><label></label>Register</a></TD>
              		</TR>
           			</table>
          		</form>
			</TD>
			</TR>
		
			<tr>
			<td colspan="8" align="center">
        		<form method="post" name="index_restaurantLoginForm" onSubmit="return checkRestaurant(this)" action="">
					<table>
					<TR>
                	<TD align=right width=73>Restaurant:</TD>
                	<TD width=62><INPUT id=username size=10 name=username></TD>
                	<TD align=right width=54>Password:</TD>
                	<TD width=62><INPUT id=password type=password size=10  name=password></TD>
                	<TD align="center" width=59>
                		<label><input type="submit" name="Submit" value="Login"></label></TD>
                	<TD align="center" width=59><a href="register.html" target=_blank><label></label>register</a></TD>
                	</TR>
					</table>
				</form>
			</td>
			</tr>
		</TABLE>
		<br>
      </div>
<% } else { %>
	<table cellSpacing="0" cellPadding="0" width="100%" border="0">
	  <tr><div align="center">Hello, <%= session.getAttribute("username") %>, Welcome to Lumen!</div><br></tr>
<% } %>   
	  <form action="./servlet/FoodSearching" method="post">
        <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr> 
            <td>
				 
			 <div align="center"> 
                <select name="select_restaurant" onChange="changelocation(document.frmLink.L_CityID.options[document.frmLink.L_CityID.selectedIndex].value)" style="width:80px">
                  <option value="0">Any</option>
                  <%=DisplayRestaurantPage.getRestaurantListItems()%>
                  <!--
                  <option value="1">Ground floor restaurant</option>
                  <option value="2">LG1</option>
                  <option value="3">LG5 Mc</option>
                  <option value="4">LG5 Thai</option>
                  <option value="5">LG5 Japanese</option>
                  <option value="6">LG5 Western</option>
                  --> 
                </select>
			  </div>
			  
			  </td>
            <td align="center"><input name="price_search" type="text" class="input" id="keyword" size="30" value="search for prices" onMouseDown="this.value=''"></td>
            <td align="center"><input name="keyword_search" type="text" class="input" id="keyword" size="30" value="search for keywords" onMouseDown="this.value=''"></td>
			<td width="63" align="center"><input name="search_button" type="submit" id="button1" value="Search"></td>
          </tr>
        </table>
      </form>
</table>

<table cellSpacing=0 cellPadding=0 width=470 align=center border=0 >
  
  <TR><TD colSpan=2 height=50><div align="center"><span class="18 STYLE2"><strong>Lumen Restaurant Information </strong></span></div></TD></TR>
  
  <tr>
  	<td>
  		<form action="./servlet/RestaurantQuery" method="post" name = "EnterRestaurant">        
	 		<div align="center"> 
          		<select name="Restaurant_Enter" onChange="" style="width:280px">  
            		<%= DisplayRestaurantPage.getRestaurantListItems()%>
          		</select> 
           		<input type="submit" name="enter" value="Enter">           
	  		</div>	
		</form>
	
  	</td>
 </tr>
 
</table>

</BODY>
</HTML>